/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mbos.entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Farnsbert
 */
@Entity
@Table(name = "Company")
public class Company implements Serializable {

    private static final long serialVersionUID = 1l;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, unique = true)
    private Integer id;
    @NotNull
    @Column(name = "company_name", length = 40)
    private String companyName;
    @NotNull
    @Column(name = "company_addr", length = 255)
    private String companyAddr;
    @NotNull
    @Column(name = "tax_identification_number", length = 15, nullable = false)
    private String tin;
    @NotNull
    @Column(name = "bureau_internal_revenue", length = 15, nullable = false)
    private String bir;
    
    @Column(name = "main_hotline")
    private String hotline;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "companyId")
    private List<Branch> branchCollection;
    @JoinColumn(name = "system_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private System companyId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyAddr() {
        return companyAddr;
    }

    public void setCompanyAddr(String companyAddr) {
        this.companyAddr = companyAddr;
    }

    public String getTin() {
        return tin;
    }

    public void setTin(String tin) {
        this.tin = tin;
    }

    public String getBir() {
        return bir;
    }

    public void setBir(String bir) {
        this.bir = bir;
    }

    public String getHotline() {
        return hotline;
    }

    public void setHotline(String hotline) {
        this.hotline = hotline;
    }

    public Collection<Branch> getBranchCollection() {
        return branchCollection;
    }

    public void setBranchCollection(List<Branch> branchCollection) {
        this.branchCollection = branchCollection;
    }

    public System getCompanyId() {
        return companyId;
    }

    public void setCompanyId(System companyId) {
        this.companyId = companyId;
    }
    
}
